package br.com.techfor.command;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.hibernate.Session;

import br.com.techfor.dao.GenericDAO;
import br.com.techfor.dao.impl.GenericDAOImpl;
import br.com.techfor.model.Setor;
import br.com.techfor.util.HibernateUtil;

public class ConsultarFuncionario implements InterfaceCommand {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) {
		GenericDAO<Setor> sdao = new GenericDAOImpl<Setor>(Setor.class,
				(Session) request.getAttribute(HibernateUtil.HIBERNATE_SESSION));
		List<Setor> setores = sdao.getBeans();
		request.setAttribute("setores", setores);

		return "consultafuncionarios.jsp";
	}

}
